{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8VfX9x/HXNzd7QiCBQNiEEWbIuLFuRUVFQVFRkhBI\nAlhnrQvraK3aarXOoiIZhCSAOCpOHLgHN4OwZ9gjkLCSkITM7++PpP2hRQnk3pw7Ps/Hw5I7z9sj\nvHu495zvR2mtEUII4fzcjA4ghBCiY0jhCyGEi5DCF0IIFyGFL4QQLkIKXwghXIQUvhBCuAgpfCGE\ncBFS+EII4SKk8IUQwkW4Gx3gZF27dtV9+/Y1OoYQQjiUoqKiQ1rrkNM9z64Kv2/fvhQWFhodQwgh\nHIpSaldbnicf6QghhIuwWuErpUxKqWKl1Iett4OVUp8rpba2/trZWtsSQghx5qx5hH83sPGk27OB\n5VrrCGB5620hhBAGsUrhK6XCgauB9JPungBkt/6cDUy0xraEEEKcHWsd4b8IPAA0n3RfN611aevP\nB4BuVtqWEEKIs9DuwldKjQfKtNZFv/Yc3TJl5ZSTVpRSM5VShUqpwvLy8vbGEUII8SuscYR/LnCt\nUmonsBi4RCmVCxxUSoUBtP5adqoXa63f0FrHaK1jQkJOexqpEEKIs9TuwtdaP6S1Dtda9wVuBr7U\nWicC7wPJrU9LBpa2d1vCdXy4Zj9bD1YZHUMIp2LL8/CfBi5TSm0FxrbeFuK0Xv26hDsWFnPj3J/Y\nfEBKXwhrsWrha62/1lqPb/35sNb6Uq11hNZ6rNb6iDW3JZxT9o87+ceyzVwe2Q0vdzcS0i3sOFRt\ndCwhnIJcaSvsxluFe/jz++u5LLIbcxLGkJdmpllrEuatYO/RGqPjCeHwpPCFXfhoTSkPvrOG8yO6\n8q8pUXiY3BgYGsCClDiq6hpJTLdQVnnC6JhCODQpfGG4Lzcd5O7Fx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+F+fSehT3ImACMrXWTxkcqUMppc4DvgPW8v+fV/+J\nls/xlwC9aVnZ9Sat9RFDQhpIKXURcJ/WerxSqgsuuk+UUqNp+QLbE9gOTKflQNou94cUvhBCuAj5\nSEcIIVyEFL4QQrgIKXwhhHARUvhCCOEipPCFEMJFSOELIYSLkMIXQggXIYUvhBAu4v8AbqsYvxlM\n4dwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2a3ef475d68>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "N = 10\n",
    "X = np.array([[0, 1], [1, 1]])\n",
    "a,b=np.linalg.eig(X)\n",
    "sumX = 0\n",
    "sumY = 0\n",
    "listX = []\n",
    "listY = []\n",
    "x = -1\n",
    "y = 1\n",
    "for i in range(N):\n",
    "    F = b.dot(np.diag(a)**i).dot(np.linalg.inv(b))\n",
    "    if(i%2 == 0):\n",
    "        x = x * -1\n",
    "    else:\n",
    "        y = y * -1\n",
    "    sumX = sumX + F[1][1]*x\n",
    "    sumY = sumY + F[1][1]*y\n",
    "    listX.append(sumX)\n",
    "    listY.append(sumY)\n",
    "    \n",
    "plt.plot(listX, listY)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[  2.68638100e+208   4.34665577e+208]\n",
      " [  4.34665577e+208   7.03303677e+208]]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "N = 1000\n",
    "X = np.array([[0, 1], [1, 1]])\n",
    "a,b=np.linalg.eig(X)\n",
    "F = b.dot(np.diag(a)**N).dot(np.linalg.inv(b))\n",
    "print(F)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 传统方法和特征值分解方法对比"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "fib_opt_seq run cost time is  0.2211771526173152\n",
      "43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875\n",
      "fib_eig_seq run cost time is  0.09850714124627302\n",
      "4.34665576869e+208\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt  \n",
    "\n",
    "import time\n",
    "def time_cost(f):\n",
    "    def _f(*arg, **kwarg):\n",
    "        start = time.clock()\n",
    "        a=f(*arg,**kwarg)\n",
    "        end = time.clock()\n",
    "        print(f.__name__,\"run cost time is \",end-start)\n",
    "        return a\n",
    "    return _f\n",
    "\n",
    "   \n",
    "@time_cost\n",
    "def fib_opt_seq(seq):\n",
    "    return [fib_opt(i) for i in seq]\n",
    "    \n",
    "def fib_opt(n):\n",
    "    a,b,i=0,1,0\n",
    "    \n",
    "    while i<n:\n",
    "        a,b=b,a+b\n",
    "        i+=1\n",
    "    else:\n",
    "        return b    \n",
    "\n",
    "@time_cost\n",
    "def fib_eig_seq(seq):\n",
    "    return [fib_eig(i) for i in seq]\n",
    "\n",
    "def fib_eig(n):\n",
    "    X = np.array([[0, 1], [1, 1]])\n",
    "    a,b=np.linalg.eig(X)\n",
    "    F = b.dot(np.diag(a)**n).dot(np.linalg.inv(b))\n",
    "    return F[1][1]\n",
    "    \n",
    "import random\n",
    "#seq = [random.randint(800,1000) for i in xrange(1000)]\n",
    "seq = range(1000)\n",
    "\n",
    "a=fib_opt_seq(seq)\n",
    "print(a[len(seq)-1])\n",
    "# write Your code fib_eig_seq function\n",
    "b=fib_eig_seq(seq)\n",
    "print(b[len(seq)-1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {
    "collapsed": false,
    "scrolled": false
   },
   "outputs": [
    {
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+O+dFHH1FdXc2J\nEydobm7m1VdfBWDTpk3U19ezbds23J1bb72V3/72t1x33XUZHXfv3r1s2bKFDz/8kMsvv5ylS5ey\nY8cOnn/+eXbu3MnJkyeZNm0a06dP71vF80AhICID2sGD2ZVnouN0EMDWrVu566672LVrF5s2bWLT\npk1MnToVgOPHj1NfX59xCNx8880MGzaMYcOGcfHFF/Pee+/x+9//nvnz51NcXExxcTFf/vKX+17x\nPFAIiMiAVlERnQLqqjwXZs2axZEjR2hpacHdWb58Offdd1+fjjVs2LAz60VFRbS3t+emknmkMQER\nGdBWrYKSkrPLSkqi8lzYu3cvp06dorS0lDlz5vD0009z/PhxAJqamjh8+HC/jj979mx+/etfc+LE\nCY4fP86GDRtyUe2cUU9ARAa0jvP+K1ZEp4AqKqIA6Ot4AHw6JgDRXbdr166lqKiIm266iT179jBr\n1iwgGgx+9tlnufjii8/s297eftY3/t5cffXV3HrrrUyePJlLLrmEq666is997nN9r3yOmbsXug49\nSqVSXldXV+hqiEgO7dmzhyuuuKLQ1eiT9evXU1tby7p16zLe5/jx44wYMYK2tjauu+46ampqmDZt\nWs7q1NXf08y2u3uqt33VExARydB3vvMd1q9fz5o1a7Lab8mSJezevZsTJ06wePHinAZAf6knICLn\n3WDuCQxE/ekJaGBYRCRgCgERkYApBEREAqYQEBEJmEJARIK0atUqJk2axOTJk6muruaNN96gqqqK\nI0eO5PV9V65cec4Ecpm877x58zh69GjO66MQEJGBL8dzSW/dupUNGzbw5ptv8tZbb7F582bGjRuX\nk6rmy8aNG7noootyftxeQ8DMis1sm5ntNLN3zOyxuHylmTWZ2Y54mZe2z3Iz229m+8xsTlr5dDN7\nO35ttemnhUSkN3mYS7q5uZnRo0efufN39OjRXHrppQD85Cc/Ydq0aVx11VXs3bsXgG3btjFr1iym\nTp3KNddcw759+wBYs2YNt99+O3PnzmXChAk8/PDDZ97jqaee4vOf/zwzZszg3nvv5etf/3pGdVuw\nYAHTp09n0qRJ1NTUnCnPWy/F3XtcAANGxOtD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/wHXKC3dvdvc34/UPiT4UyojauzbebC2woDA1zA8zKwdu\nBp5MK056mz8HXAc8BeDun7j7URLebqIp7oeb2QVACfD/SWCb3f23wPudirtr53zgOXf/2N3fBfYT\nfe71W1JCoAw4lPa8MS5LNDOrAqYCbwCXuHtz/NJfgEsKVK18+THwMHA6rSzpbR4PtAC/iE+DPWlm\nf0OC2+3uTcAPgYNAM3DM3TeR4DZ30l078/YZl5QQCI6ZjQCeB/7B3T9If82jS74Sc9mXmd0CHHb3\n7d1tk7Q2xy4ApgFPuPtU4L/odBokae2Oz4HPJwrAS4G/MbM70rdJWpu7c77amZQQaALGpT0vj8sS\nycyGEgVArbu/EBe/Z2Zj49fHAocLVb88mA3camYHiE713WBmz5LsNkP0ba/R3d+In/8HUSgkud3/\nE3jX3Vvc/STwAnANyW5zuu7ambfPuKSEwP8FJpjZeDP7DNEAyosFrlNemJkRnSPe4+7/kvbSi8Di\neH0xsP581y1f3H25u5e7exXRv+2r7n4HCW4zgLv/BThkZpfHRTcCu0l2uw8CM82sJP5v/Uaica8k\ntzldd+18EVhoZsPMbDwwAdiWk3d090QswDzgT8CfgRWFrk8e23ktURfxLWBHvMwDSomuJqgHNgOj\nCl3XPLX/emBDvJ74NgPVQF387/1/gJFJbzfwGLAX2AX8EhiWxDYD/0407nGSqNd3T0/tBFbEn2/7\ngC/lqh66Y1hEJGBJOR0kIiJ9oBAQEQmYQkBEJGAKARGRgCkEREQCphAQEQmYQkBEJGAKARGRgP03\n6ZnX2owsg+oAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x131e622dc88>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "N = 100\n",
    "A = np.array([[3200, 4000]])\n",
    "X = np.array([[0.8, 0.2], [0.1, 0.9]])\n",
    "listBJ = []\n",
    "listSH = []\n",
    "a,b=np.linalg.eig(X)\n",
    "for i in range(N):\n",
    "    F = b.dot(np.diag(a)**(i+1)).dot(np.linalg.inv(b))\n",
    "    A2 = A.dot(F)\n",
    "    listBJ.append(A2[0][0])\n",
    "    listSH.append(A2[0][1])\n",
    "listAxis = [i+1 for i in range(N)]\n",
    "plt.plot(listAxis, listBJ, 'bo', label='BeiJing')\n",
    "plt.plot(listAxis, listSH, 'ro', label='ShangHai')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
